<?php

/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
 * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Admin;

return array(
    'router' => array(
	'routes' => array(
	    'admin' => array(
		'type' => 'Literal',
		'options' => array(
		    'route' => '/admin',
		    'defaults' => array(
			'__NAMESPACE__' => 'Admin\Controller',
			'controller' => 'Index',
			'action' => 'index',
		    ),
		),
		'may_terminate' => true,
		'child_routes' => array(
		    'default' => array(
			'type' => 'Segment',
			'options' => array(
			    'route' => '/[:controller[/:action]]',
			    'constraints' => array(
				'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
				'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
			    ),
			    'defaults' => array(
			    ),
			),
		    ),
		),
	    ),
	),
    ),
    'service_manager' => array(
	'abstract_factories' => array(
	    'Zend\Cache\Service\StorageCacheAbstractServiceFactory',
	    'Zend\Log\LoggerAbstractServiceFactory',
	),
	'aliases' => array(
	    'translator' => 'MvcTranslator',
	),
    ),
    'translator' => array(
	'locale' => 'en_US',
	'translation_file_patterns' => array(
	    array(
		'type' => 'gettext',
		'base_dir' => __DIR__ . '/../language',
		'pattern' => '%s.mo',
	    ),
	),
    ),
    'controllers' => array(
	'invokables' => array(
	    'Admin\Controller\Index' => 'Admin\Controller\IndexController',
            'Admin\Controller\Product' => 'Admin\Controller\ProductController',
	),
    ),
    'view_manager' => array(
	'display_not_found_reason' => true,
	'display_exceptions' => true,
	'doctype' => 'HTML5',
	'not_found_template' => 'error/404',
	'exception_template' => 'error/index',
	'template_map' => array(
	    'layout/layout' => __DIR__ . '/../view/layout/admin.phtml',
	    'admin/index/index' => __DIR__ . '/../view/admin/index/index.phtml',
	    'error/404' => __DIR__ . '/../view/error/404.phtml',
	    'error/index' => __DIR__ . '/../view/error/index.phtml',
	),
	'template_path_stack' => array(
	    __DIR__ . '/../view',
	),
    ),
    'view_helpers' => array(
	'invokables' => array(
	    'formElementErrorFlash' => 'Auth\View\Helper\FormElementErrorFlash',
	),
    ),
    // Placeholder for console routes
    'console' => array(
	'router' => array(
	    'routes' => array(
	    ),
	),
    ),
    // Doctrine config
    'doctrine' => array(
	'driver' => array(
	    __NAMESPACE__ . '_driver' => array(
		'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
		'cache' => 'array',
		'paths' => array(__DIR__ . '/../src/' . __NAMESPACE__ . '/Entity')
	    ),
	    'orm_default' => array(
		'drivers' => array(
		    __NAMESPACE__ . '\Entity' => __NAMESPACE__ . '_driver'
		)
	    )
	)
    ),
);
